package BuilderPattern.exercise7_2;

public abstract class Builder {
    private boolean init;

    public void buildTitle(String title) {
        makeTitle(title);
        init = true;
    }

    public void buildString(String str) {
        if (!init) {
            makeString(str);
        }
    }

    public void buildItems(String[] items) {
        if (!init) {
            makeItems(items);
        }
    }

    public void buildClose() {
        if (!init) {
            close();
        }
    }

    protected abstract void makeTitle(String title);

    protected abstract void makeString(String str);

    protected abstract void makeItems(String[] items);

    protected abstract void close();
}
